<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>修改菜单</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="修改,菜单">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	
  </head>
  
  <body style="margin:0 0 0 0; overflow:hidden">
    <center>
    	<s:form name="frm" id="frm" method="post">
    		<s:hidden name="menu.id"></s:hidden>
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'系统管理'},{'name':'菜单管理'},{'name':'修改菜单'}]"/>
    			<jsp:param name="width" value="80%"/>
    		</jsp:include>
	    	<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#CCCCCC">
	    		<tr bgcolor="#FFFFFF">
	    			<td class="label" width="18%" height="30px" align="right">
	    				上级节点：
	    			</td>
	    			<td width="32%" align="left">
	    				<s:select name="menu.parentId" id="parentId" list="menuList" listKey="id" listValue="menuName" cssStyle="width:120"></s:select>
	    			</td>
	    			<td class="label" width="18%" align="right">
	    				节点名称：
	    				<br>
    					<font color="red">(20字以内)</font>
	    			</td>
	    			<td width="32%" align="left">
	    				<s:textfield name="menu.menuName" id="menuName" cssStyle="width:100%" cssClass="notNull" maxlength="20"></s:textfield>
	    			</td>
	    		</tr>
	    		<tr bgcolor="#FFFFFF">
	    			<td class="label" align="right" height="30px">
	    				链接地址：
	    				<br>
    					<font color="red">(150字以内)</font>
	    			</td>
	    			<td class="label" align="left" colspan="3">
	    				<s:textfield name="menu.url" id="url" cssStyle="width:100%" maxlength="150"></s:textfield>
	    			</td>
	    		</tr>
	    		<tr bgcolor="#FFFFFF">
	    			<td class="label" align="right" height="30px">
	    				排序：
	    			</td>
	    			<td align="left">
	    				<s:textfield name="menu.sort" id="sort" cssStyle="width:80%"></s:textfield>
	    			</td>
	    			<td class="label" align="right">
	    				是否显示：
	    			</td>
	    			<td align="left">
	    				<s:select list='#{"Y":"是", "N":"否"}' name="menu.isShow" id="isShow" cssStyle="width:60px"></s:select>
	    			</td>
	    		</tr>
	    	</table>
	    	
	    	<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="修改" class="btn" onclick="updateMenu()" />
    				</td>
    			</tr>
    		</table>
    	</s:form>
    </center>
    
    <script type="text/javascript">
	function updateMenu()
	{
		var menuName = $('#menuName');
		var sort = $('#sort');
		if('' == menuName.val().Trim())
		{
			showMsg('菜单名称不能为空。', function(){menuName.focus();});
			return;
		}
		if(('' != sort.val().Trim() && checkInteger(sort) == false) || '' == sort.val().Trim())
		{
			showMsg('排序必须为数字。', function(){sort.focus();});
			return;
		}
		$.ajax({
    		url:'${CONTEXT_PATH}/inner/menu/updateMenu.action',
    		type:'post',
    		data:$("#frm").serialize(),
    		success:
    			function(result){
    				showMsg('修改成功。', function(){
    					var pWin = parent.window.dialogArguments;
    					pWin.location.href = pWin.location.href;
			    		window.close();
			    	});
    			}
    	});
	}
	</script>
  </body>
</html>
